package org.apache.ocean.main.util;

import java.io.IOException;
import java.io.OutputStream;

import org.apache.lucene.store.IndexOutput;

public class IndexOutputStream extends OutputStream {
	private IndexOutput indexOutput;

	public IndexOutputStream(IndexOutput indexOutput) {
		this.indexOutput = indexOutput;
	}
  
	public void close() throws IOException {
		indexOutput.close();
	}
	
	public void write(byte[] b) throws IOException {
		indexOutput.writeBytes(b, b.length);
	}
	
	public void write(byte[] b, int offset, int length) throws IOException {
		indexOutput.writeBytes(b, offset, length);
	}

	public void write(int b) throws IOException {
		indexOutput.writeByte((byte) b);
	}
}